.class public final Lnbisdk/w;
.super Ljava/lang/Thread;

# interfaces
.implements Lcom/navbuilder/nb/a;


# static fields
.field private static O:[B


# instance fields
.field private volatile L:Z

.field private volatile M:J

.field private N:Lnbisdk/hh;

.field private P:Ljava/lang/String;

.field private Q:Lnbisdk/bv;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    new-array v0, v0, [B

    sput-object v0, Lnbisdk/w;->O:[B

    return-void
.end method

.method public constructor <init>(Lnbisdk/bv;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lnbisdk/w;->L:Z

    const-wide/16 v0, -0x1

    iput-wide v0, p0, Lnbisdk/w;->M:J

    invoke-static {}, Lnbisdk/ix;->gN()Lnbisdk/ix;

    move-result-object v0

    invoke-virtual {v0}, Lnbisdk/ix;->dh()Lnbisdk/le;

    move-result-object v0

    const-string v1, "URL_EXTENSION"

    invoke-virtual {v0, v1}, Lnbisdk/le;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lnbisdk/w;->P:Ljava/lang/String;

    invoke-static {}, Lnbisdk/ix;->gN()Lnbisdk/ix;

    move-result-object v0

    invoke-virtual {v0}, Lnbisdk/ix;->dh()Lnbisdk/le;

    move-result-object v0

    const-string v1, "D_TCP"

    invoke-virtual {v0, v1}, Lnbisdk/le;->al(Ljava/lang/String;)Z

    invoke-static {}, Lnbisdk/ix;->gN()Lnbisdk/ix;

    move-result-object v0

    invoke-virtual {v0}, Lnbisdk/ix;->dh()Lnbisdk/le;

    move-result-object v0

    const-string v1, "BIS_TCP"

    invoke-virtual {v0, v1}, Lnbisdk/le;->al(Ljava/lang/String;)Z

    iput-object p1, p0, Lnbisdk/w;->Q:Lnbisdk/bv;

    invoke-static {}, Lnbisdk/ix;->gN()Lnbisdk/ix;

    move-result-object v0

    invoke-virtual {v0, p0}, Lnbisdk/ix;->a(Lcom/navbuilder/nb/a;)V

    return-void
.end method

.method private a(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;
    .locals 1

    invoke-static {p3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {p1, p2, v0}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private static a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 4

    new-instance v0, Ljava/lang/StringBuffer;

    invoke-direct {v0}, Ljava/lang/StringBuffer;-><init>()V

    invoke-virtual {p0, p1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v1

    const/4 v2, -0x1

    if-eq v1, v2, :cond_0

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v3, 0x0

    invoke-virtual {p0, v3, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v2

    add-int/2addr v1, v2

    invoke-virtual {p0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v1

    :goto_0
    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_0
    move-object v1, p0

    goto :goto_0
.end method

.method private static a(Ljava/lang/String;[BLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 3

    if-eqz p1, :cond_1

    array-length v0, p1

    if-lez v0, :cond_1

    new-instance v0, Ljava/lang/StringBuffer;

    invoke-direct {v0, p0}, Ljava/lang/StringBuffer;-><init>(Ljava/lang/String;)V

    const-string v1, "&"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v0

    invoke-virtual {v0, p3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v0

    const-string v1, "="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v0

    new-instance v1, Ljava/lang/String;

    invoke-static {p1}, Lnbisdk/sf;->v([B)[C

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/String;-><init>([C)V

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v0

    if-eqz p2, :cond_0

    const-string v1, ""

    invoke-virtual {p2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    const-string v1, "&"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v1, p4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    const-string v2, "="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    :cond_0
    invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_1
    move-object v0, p0

    goto :goto_0
.end method

.method static synthetic a(Lnbisdk/w;Lnbisdk/hh;)Ljava/lang/String;
    .locals 11

    const/4 v6, 0x0

    const/4 v10, 0x1

    const-string v0, ""

    invoke-virtual {p1}, Lnbisdk/hh;->getType()Ljava/lang/String;

    move-result-object v1

    const-string v2, "road"

    if-ne v1, v2, :cond_3

    invoke-static {}, Lnbisdk/iq;->gD()Lnbisdk/jg;

    move-result-object v0

    :cond_0
    :goto_0
    invoke-virtual {v0}, Lnbisdk/jg;->getUrl()Ljava/lang/String;

    move-result-object v1

    :goto_1
    const-string v2, "$q"

    invoke-virtual {v1, v2}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v2

    const/4 v3, -0x1

    if-eq v2, v3, :cond_9

    const-string v2, "$q"

    invoke-virtual {p1}, Lnbisdk/hh;->getX()I

    move-result v3

    invoke-virtual {p1}, Lnbisdk/hh;->getY()I

    move-result v4

    invoke-virtual {p1}, Lnbisdk/hh;->fK()I

    move-result v5

    new-instance v6, Ljava/lang/StringBuffer;

    invoke-direct {v6}, Ljava/lang/StringBuffer;-><init>()V

    :goto_2
    if-lez v5, :cond_8

    const/4 v7, 0x0

    sub-int v8, v5, v10

    shl-int v8, v10, v8

    and-int v9, v3, v8

    if-eqz v9, :cond_1

    move v7, v10

    :cond_1
    and-int/2addr v8, v4

    if-eqz v8, :cond_2

    add-int/lit8 v7, v7, 0x2

    int-to-byte v7, v7

    :cond_2
    invoke-virtual {v6, v7}, Ljava/lang/StringBuffer;->append(I)Ljava/lang/StringBuffer;

    add-int/lit8 v5, v5, -0x1

    goto :goto_2

    :cond_3
    invoke-virtual {p1}, Lnbisdk/hh;->getType()Ljava/lang/String;

    move-result-object v1

    const-string v2, "traffic"

    if-ne v1, v2, :cond_4

    invoke-static {}, Lnbisdk/iq;->gH()Lnbisdk/jg;

    move-result-object v0

    goto :goto_0

    :cond_4
    invoke-virtual {p1}, Lnbisdk/hh;->getType()Ljava/lang/String;

    move-result-object v1

    const-string v2, "route"

    if-ne v1, v2, :cond_5

    invoke-static {}, Lnbisdk/iq;->gG()Lnbisdk/jg;

    move-result-object v0

    invoke-virtual {v0}, Lnbisdk/jg;->getUrl()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1}, Lnbisdk/hh;->fN()[B

    move-result-object v2

    invoke-virtual {p1}, Lnbisdk/hh;->fP()Ljava/lang/String;

    move-result-object v3

    const-string v4, "rid1"

    const-string v5, "rc1"

    invoke-static {v1, v2, v3, v4, v5}, Lnbisdk/w;->a(Ljava/lang/String;[BLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "rid2"

    const-string v3, "rc2"

    invoke-static {v1, v6, v6, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;[BLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    goto :goto_1

    :cond_5
    invoke-virtual {p1}, Lnbisdk/hh;->getType()Ljava/lang/String;

    move-result-object v1

    const-string v2, "satellite"

    if-ne v1, v2, :cond_7

    invoke-static {}, Lnbisdk/iq;->gE()Lnbisdk/jg;

    move-result-object v0

    if-nez v0, :cond_6

    invoke-static {}, Lnbisdk/iq;->gD()Lnbisdk/jg;

    move-result-object v0

    :cond_6
    invoke-virtual {v0}, Lnbisdk/jg;->getUrl()Ljava/lang/String;

    move-result-object v1

    goto :goto_1

    :cond_7
    invoke-virtual {p1}, Lnbisdk/hh;->getType()Ljava/lang/String;

    move-result-object v1

    const-string v2, "hybrid"

    if-ne v1, v2, :cond_a

    invoke-static {}, Lnbisdk/iq;->gF()Lnbisdk/jg;

    move-result-object v0

    if-nez v0, :cond_0

    invoke-static {}, Lnbisdk/iq;->gD()Lnbisdk/jg;

    move-result-object v0

    goto/16 :goto_0

    :cond_8
    invoke-virtual {v6}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    :goto_3
    const-string v2, "$sz"

    invoke-virtual {p1}, Lnbisdk/hh;->getSize()I

    move-result v3

    invoke-direct {p0, v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v1

    const-string v2, "$fmt"

    invoke-virtual {p1}, Lnbisdk/hh;->getFormat()Ljava/lang/String;

    move-result-object v3

    invoke-static {v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "$res"

    invoke-virtual {p1}, Lnbisdk/hh;->fM()Ljava/lang/String;

    move-result-object v3

    invoke-static {v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "$loc"

    invoke-virtual {p1}, Lnbisdk/hh;->df()Ljava/lang/String;

    move-result-object v3

    invoke-static {v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "$v"

    invoke-virtual {v0}, Lnbisdk/jg;->he()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v2, v0}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-wide/16 v1, 0x100

    const/16 v3, 0x8

    invoke-static {v0, v1, v2, v3}, Lnbisdk/pn;->a(Ljava/lang/String;JB)V

    return-object v0

    :cond_9
    const-string v2, "$x"

    invoke-virtual {p1}, Lnbisdk/hh;->getX()I

    move-result v3

    invoke-direct {p0, v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v1

    const-string v2, "$y"

    invoke-virtual {p1}, Lnbisdk/hh;->getY()I

    move-result v3

    invoke-direct {p0, v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v1

    const-string v2, "$z"

    invoke-virtual {p1}, Lnbisdk/hh;->fK()I

    move-result v3

    invoke-direct {p0, v1, v2, v3}, Lnbisdk/w;->a(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v1

    goto :goto_3

    :cond_a
    move-object v1, v0

    move-object v0, v6

    goto/16 :goto_1
.end method

.method static synthetic a(Lnbisdk/w;)Lnbisdk/hh;
    .locals 1

    iget-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    return-object v0
.end method

.method private static a([B)Z
    .locals 4

    const/4 v3, 0x1

    const/4 v2, 0x0

    if-nez p0, :cond_0

    move v0, v2

    :goto_0
    return v0

    :cond_0
    array-length v0, p0

    const/4 v1, 0x4

    if-ge v0, v1, :cond_1

    move v0, v2

    goto :goto_0

    :cond_1
    aget-byte v0, p0, v2

    const/16 v1, 0x89

    if-eq v0, v1, :cond_2

    aget-byte v0, p0, v3

    const/16 v1, 0x50

    if-eq v0, v1, :cond_2

    const/4 v0, 0x2

    aget-byte v0, p0, v0

    const/16 v1, 0x4e

    if-eq v0, v1, :cond_2

    const/4 v0, 0x3

    aget-byte v0, p0, v0

    const/16 v1, 0x47

    if-eq v0, v1, :cond_2

    move v0, v2

    goto :goto_0

    :cond_2
    move v0, v3

    goto :goto_0
.end method

.method static synthetic b(Lnbisdk/w;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lnbisdk/w;->P:Ljava/lang/String;

    return-object v0
.end method


# virtual methods
.method final D()J
    .locals 2

    iget-wide v0, p0, Lnbisdk/w;->M:J

    return-wide v0
.end method

.method final E()Lnbisdk/hh;
    .locals 1

    iget-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    return-object v0
.end method

.method final F()V
    .locals 1

    iget-boolean v0, p0, Lnbisdk/w;->L:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    iput-boolean v0, p0, Lnbisdk/w;->L:Z

    :try_start_0
    invoke-virtual {p0}, Lnbisdk/w;->interrupt()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public final a(S)V
    .locals 1

    const/4 v0, 0x1

    iput-boolean v0, p0, Lnbisdk/w;->L:Z

    iget-object v0, p0, Lnbisdk/w;->Q:Lnbisdk/bv;

    invoke-virtual {v0}, Lnbisdk/bv;->stop()V

    return-void
.end method

.method public final run()V
    .locals 12

    const-wide/16 v9, -0x1

    const/4 v8, 0x0

    iget-object v0, p0, Lnbisdk/w;->Q:Lnbisdk/bv;

    invoke-virtual {v0}, Lnbisdk/bv;->eF()V

    new-instance v1, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v1}, Ljava/io/ByteArrayOutputStream;-><init>()V

    const/16 v0, 0x1400

    new-array v2, v0, [B

    :cond_0
    :goto_0
    iget-boolean v0, p0, Lnbisdk/w;->L:Z

    if-nez v0, :cond_2

    iput-wide v9, p0, Lnbisdk/w;->M:J

    iget-object v0, p0, Lnbisdk/w;->Q:Lnbisdk/bv;

    invoke-virtual {v0}, Lnbisdk/bv;->eD()Lnbisdk/hh;

    move-result-object v0

    iput-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    iget-boolean v0, p0, Lnbisdk/w;->L:Z

    if-nez v0, :cond_2

    iget-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v0}, Lnbisdk/hh;->fQ()Lnbisdk/dm;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    iput-wide v3, p0, Lnbisdk/w;->M:J

    iget-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v0}, Lnbisdk/hh;->fQ()Lnbisdk/dm;

    move-result-object v0

    check-cast v0, Lnbisdk/jq;

    :try_start_0
    invoke-virtual {v0}, Lnbisdk/jq;->cm()Lnbisdk/qv;

    move-result-object v3

    new-instance v4, Lnbisdk/w$1;

    invoke-direct {v4, p0}, Lnbisdk/w$1;-><init>(Lnbisdk/w;)V

    invoke-interface {v3, v4}, Lnbisdk/qv;->b(Lnbisdk/sl;)Lnbisdk/kg;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_f
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v3

    :try_start_1
    iget-boolean v4, p0, Lnbisdk/w;->L:Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_10
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_d

    if-eqz v4, :cond_3

    if-eqz v3, :cond_1

    :try_start_2
    invoke-interface {v3}, Lnbisdk/kg;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2

    :cond_1
    :goto_1
    iput-object v8, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    :cond_2
    :goto_2
    iget-object v0, p0, Lnbisdk/w;->Q:Lnbisdk/bv;

    invoke-virtual {v0}, Lnbisdk/bv;->eG()V

    return-void

    :cond_3
    :try_start_3
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    iput-wide v4, p0, Lnbisdk/w;->M:J

    invoke-interface {v3}, Lnbisdk/kg;->x()Ljava/io/InputStream;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_10
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_d

    move-result-object v4

    :try_start_4
    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v5

    iput-wide v5, p0, Lnbisdk/w;->M:J

    :goto_3
    iget-boolean v5, p0, Lnbisdk/w;->L:Z

    if-nez v5, :cond_7

    invoke-virtual {v4, v2}, Ljava/io/InputStream;->read([B)I

    move-result v5

    const/4 v6, -0x1

    if-eq v5, v6, :cond_7

    const/4 v6, 0x0

    invoke-virtual {v1, v2, v6, v5}, Ljava/io/ByteArrayOutputStream;->write([BII)V

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v5

    iput-wide v5, p0, Lnbisdk/w;->M:J
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_2
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_e

    goto :goto_3

    :catch_0
    move-exception v5

    move-object v11, v5

    move-object v5, v4

    move-object v4, v3

    move-object v3, v11

    :goto_4
    :try_start_5
    iget-boolean v6, p0, Lnbisdk/w;->L:Z

    if-nez v6, :cond_4

    iget-object v6, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-interface {v0, v6, v3}, Lnbisdk/rk;->a(Lnbisdk/hh;Ljava/lang/Exception;)V

    invoke-virtual {v3}, Ljava/io/IOException;->printStackTrace()V

    sget-boolean v0, Lnbisdk/bk;->cG:Z

    if-eqz v0, :cond_4

    iget-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    const/4 v3, 0x0

    const/4 v6, 0x1

    invoke-static {v0, v3, v6}, Lnbisdk/cq;->a(Lnbisdk/hh;IB)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_3

    :cond_4
    if-eqz v5, :cond_5

    :try_start_6
    invoke-virtual {v5}, Ljava/io/InputStream;->close()V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_7

    :cond_5
    :goto_5
    if-eqz v4, :cond_6

    :try_start_7
    invoke-interface {v4}, Lnbisdk/kg;->close()V
    :try_end_7
    .catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_8

    :cond_6
    :goto_6
    iput-object v8, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    goto/16 :goto_0

    :cond_7
    :try_start_8
    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v5

    iget-boolean v6, p0, Lnbisdk/w;->L:Z
    :try_end_8
    .catchall {:try_start_8 .. :try_end_8} :catchall_2
    .catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_0
    .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_e

    if-eqz v6, :cond_a

    if-eqz v4, :cond_8

    :try_start_9
    invoke-virtual {v4}, Ljava/io/InputStream;->close()V
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_3

    :cond_8
    :goto_7
    if-eqz v3, :cond_9

    :try_start_a
    invoke-interface {v3}, Lnbisdk/kg;->close()V
    :try_end_a
    .catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_4

    :cond_9
    :goto_8
    iput-object v8, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    goto :goto_2

    :cond_a
    const-wide/16 v6, -0x1

    :try_start_b
    iput-wide v6, p0, Lnbisdk/w;->M:J

    iget-object v6, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v6}, Lnbisdk/hh;->getFormat()Ljava/lang/String;

    move-result-object v6

    const-string v7, "png"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_f

    invoke-static {v5}, Lnbisdk/w;->a([B)Z

    move-result v6

    if-nez v6, :cond_f

    sget-object v5, Lnbisdk/w;->O:[B

    :cond_b
    :goto_9
    new-instance v6, Lnbisdk/pc;

    iget-object v7, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-direct {v6, v7, v5}, Lnbisdk/pc;-><init>(Lnbisdk/hh;[B)V

    invoke-interface {v0, v6}, Lnbisdk/rk;->c(Lnbisdk/pc;)V

    sget-boolean v6, Lnbisdk/bk;->cG:Z

    if-eqz v6, :cond_c

    iget-object v6, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    array-length v5, v5

    const/4 v7, 0x0

    invoke-static {v6, v5, v7}, Lnbisdk/cq;->a(Lnbisdk/hh;IB)V
    :try_end_b
    .catchall {:try_start_b .. :try_end_b} :catchall_2
    .catch Ljava/io/IOException; {:try_start_b .. :try_end_b} :catch_0
    .catch Ljava/lang/Exception; {:try_start_b .. :try_end_b} :catch_e

    :cond_c
    if-eqz v4, :cond_d

    :try_start_c
    invoke-virtual {v4}, Ljava/io/InputStream;->close()V
    :try_end_c
    .catch Ljava/lang/Exception; {:try_start_c .. :try_end_c} :catch_5

    :cond_d
    :goto_a
    if-eqz v3, :cond_e

    :try_start_d
    invoke-interface {v3}, Lnbisdk/kg;->close()V
    :try_end_d
    .catch Ljava/io/IOException; {:try_start_d .. :try_end_d} :catch_6

    :cond_e
    :goto_b
    iput-object v8, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    goto/16 :goto_0

    :cond_f
    :try_start_e
    iget-object v6, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v6}, Lnbisdk/hh;->getFormat()Ljava/lang/String;

    move-result-object v6

    const-string v7, "jpg"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_b

    invoke-static {v5}, Lnbisdk/w;->a([B)Z

    move-result v6

    if-eqz v6, :cond_b

    sget-object v5, Lnbisdk/w;->O:[B
    :try_end_e
    .catchall {:try_start_e .. :try_end_e} :catchall_2
    .catch Ljava/io/IOException; {:try_start_e .. :try_end_e} :catch_0
    .catch Ljava/lang/Exception; {:try_start_e .. :try_end_e} :catch_e

    goto :goto_9

    :catch_1
    move-exception v3

    move-object v4, v8

    move-object v5, v8

    :goto_c
    :try_start_f
    iget-boolean v6, p0, Lnbisdk/w;->L:Z

    if-nez v6, :cond_10

    iget-object v6, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-interface {v0, v6, v3}, Lnbisdk/rk;->a(Lnbisdk/hh;Ljava/lang/Exception;)V

    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V

    sget-boolean v0, Lnbisdk/bk;->cG:Z

    if-eqz v0, :cond_10

    iget-object v0, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    const/4 v3, 0x0

    const/4 v6, 0x1

    invoke-static {v0, v3, v6}, Lnbisdk/cq;->a(Lnbisdk/hh;IB)V
    :try_end_f
    .catchall {:try_start_f .. :try_end_f} :catchall_3

    :cond_10
    if-eqz v5, :cond_11

    :try_start_10
    invoke-virtual {v5}, Ljava/io/InputStream;->close()V
    :try_end_10
    .catch Ljava/lang/Exception; {:try_start_10 .. :try_end_10} :catch_9

    :cond_11
    :goto_d
    if-eqz v4, :cond_12

    :try_start_11
    invoke-interface {v4}, Lnbisdk/kg;->close()V
    :try_end_11
    .catch Ljava/io/IOException; {:try_start_11 .. :try_end_11} :catch_a

    :cond_12
    :goto_e
    iput-object v8, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    goto/16 :goto_0

    :catchall_0
    move-exception v0

    move-object v2, v8

    move-object v3, v8

    :goto_f
    if-eqz v3, :cond_13

    :try_start_12
    invoke-virtual {v3}, Ljava/io/InputStream;->close()V
    :try_end_12
    .catch Ljava/lang/Exception; {:try_start_12 .. :try_end_12} :catch_b

    :cond_13
    :goto_10
    if-eqz v2, :cond_14

    :try_start_13
    invoke-interface {v2}, Lnbisdk/kg;->close()V
    :try_end_13
    .catch Ljava/io/IOException; {:try_start_13 .. :try_end_13} :catch_c

    :cond_14
    :goto_11
    iput-object v8, p0, Lnbisdk/w;->N:Lnbisdk/hh;

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V

    throw v0

    :catch_2
    move-exception v0

    goto/16 :goto_1

    :catch_3
    move-exception v0

    goto/16 :goto_7

    :catch_4
    move-exception v0

    goto/16 :goto_8

    :catch_5
    move-exception v0

    goto :goto_a

    :catch_6
    move-exception v0

    goto :goto_b

    :catch_7
    move-exception v0

    goto/16 :goto_5

    :catch_8
    move-exception v0

    goto/16 :goto_6

    :catch_9
    move-exception v0

    goto :goto_d

    :catch_a
    move-exception v0

    goto :goto_e

    :catch_b
    move-exception v3

    goto :goto_10

    :catch_c
    move-exception v2

    goto :goto_11

    :catchall_1
    move-exception v0

    move-object v2, v3

    move-object v3, v8

    goto :goto_f

    :catchall_2
    move-exception v0

    move-object v2, v3

    move-object v3, v4

    goto :goto_f

    :catchall_3
    move-exception v0

    move-object v2, v4

    move-object v3, v5

    goto :goto_f

    :catch_d
    move-exception v4

    move-object v5, v8

    move-object v11, v3

    move-object v3, v4

    move-object v4, v11

    goto :goto_c

    :catch_e
    move-exception v5

    move-object v11, v5

    move-object v5, v4

    move-object v4, v3

    move-object v3, v11

    goto :goto_c

    :catch_f
    move-exception v3

    move-object v4, v8

    move-object v5, v8

    goto/16 :goto_4

    :catch_10
    move-exception v4

    move-object v5, v8

    move-object v11, v3

    move-object v3, v4

    move-object v4, v11

    goto/16 :goto_4
.end method
